<?php
namespace app\restful\controller;

use app\api\controller\Controller;
use think\Request;

/**
 * 配置主页
 * Class Index
 * @package app\Interface\Controller
 */
class Configure extends Controller{

    /* @var \app\api\model\User $user */
    private $user;

    /**
     * 构造方法
     * @throws \app\common\exception\BaseException
     * @throws \think\exception\DbException
     */
    public function _initialize()
    {
        parent::_initialize();
        // 用户信息
        $this->user = $this->getUser();
    }

    /**
     * 基础配置
     * @return array
     * @throws \app\common\exception\BaseException
     * @throws \think\Exception
     * @throws \think\exception\DbException
     */
    public function configure(Request $request){
        $param = $request->param();
        $data = \app\restful\model\Configure::getConfigure(1);
        isset($data['s_value']) && !empty($data['s_value']) ? $data['s_value'] = unserialize($data['s_value']) : '';
        return $this->renderSuccess(['list'=>$data],'ok');
    }
}
?>